From b8e1f082ba457ddaf0e8596c26ff8d85e1b253d9 Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 8 Sep 2009 16:06:32 +0000 Subject: [PATCH] Help invocation per page, uses desktop browser for h elp. Fix German translation on Windows. Warn for no valid options. --- gui/app.pro | 6 +- gui/dpencode.cpp | 4 +- gui/dpencode.h | 4 +- gui/filterdlg.cpp | 4 +- gui/help.cpp | 4 +- gui/mainwindow.cpp | 39 ++++++--- gui/optionsdlg.cpp | 4 +- gui/setup.iss | 194 ++++++++++++++++++++++----------------------- gui/setup.iss.in | 4 +- 9 files changed, 140 insertions(+), 123 deletions(-) diff --git a/gui/app.pro b/gui/app.pro index 084bbf712..64fbe36f0 100755 --- a/gui/app.pro +++ b/gui/app.pro @@ -1,4 +1,4 @@ -# $Id: app.pro,v 1.9 2009/09/06 17:04:36 robertl Exp $ +# $Id: app.pro,v 1.10 2009/09/08 16:06:32 robertl Exp $ # CONFIG += qt release @@ -25,7 +25,9 @@ UI_DIR = tmp RESOURCES = app.qrc RC_FILE = app.rc -TARGET=GPSBabelFE +mac:TARGET=GPSBabelFE +win32:TARGET=GPSBabelFE +unix:TARGET=gpsbabelfe-bin extras.commands = (make -f makeextras.mak) extras.target = extras diff --git a/gui/dpencode.cpp b/gui/dpencode.cpp index 63f12dbf4..d06224a99 100755 --- a/gui/dpencode.cpp +++ b/gui/dpencode.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: dpencode.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $ +// $Id: dpencode.cpp,v 1.3 2009/09/08 16:06:32 robertl Exp $ //------------------------------------------------------------------------ // // Original in JavaScript: @@ -92,7 +92,7 @@ int roundToInt(double x) { //------------------------------------------------------------------------ void PolylineEncoder::createEncodings(string &encoded_points, const vector &points, - const vector dists) + const vector &dists) { encoded_points = "";; int plat = 0; diff --git a/gui/dpencode.h b/gui/dpencode.h index 3ce1afc78..8d2f13c29 100644 --- a/gui/dpencode.h +++ b/gui/dpencode.h @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: dpencode.h,v 1.1 2009/07/05 21:14:56 robertl Exp $ +// $Id: dpencode.h,v 1.2 2009/09/08 16:06:32 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -42,7 +42,7 @@ private: void encodeLevels(string &, const vector &points, const vector&dists); void createEncodings(string &encoded_points, const vector &points, - const vector dists); + const vector &dists); int numLevels; double zoomFactor; diff --git a/gui/filterdlg.cpp b/gui/filterdlg.cpp index f97987339..d542dc4ca 100644 --- a/gui/filterdlg.cpp +++ b/gui/filterdlg.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: filterdlg.cpp,v 1.3 2009/09/02 19:05:27 robertl Exp $ +// $Id: filterdlg.cpp,v 1.4 2009/09/08 16:06:32 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -118,7 +118,7 @@ void FilterDialog::resetX() //------------------------------------------------------------------------ void FilterDialog::helpX() { - ShowHelp("gpsbabel.html?#Data_Filters"); + ShowHelp("Data_Filters.html"); } //------------------------------------------------------------------------ diff --git a/gui/help.cpp b/gui/help.cpp index c98a03e4e..553674060 100644 --- a/gui/help.cpp +++ b/gui/help.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: help.cpp,v 1.5 2009/09/02 19:05:27 robertl Exp $ +// $Id: help.cpp,v 1.6 2009/09/08 16:06:32 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -31,7 +31,7 @@ void ShowHelp(const char *name) { QString urlname("file:///" + QApplication::applicationDirPath() + "/help/" + name); -#ifndef XXXX +#ifdef XXXX QWebView *view = new QWebView(); view->setWindowTitle("GPSBabel Help"); view->load(urlname); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 10a05f64b..fd8b1f40c 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: mainwindow.cpp,v 1.9 2009/09/08 00:29:09 robertl Exp $ +// $Id: mainwindow.cpp,v 1.10 2009/09/08 16:06:32 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -601,25 +601,40 @@ void MainWindow::outputFormatChanged(int comboIdx) void MainWindow::inputOptionButtonClicked() { int fidx = currentComboFormatIndex(ui.inputFormatCombo); - OptionsDlg optionDlg(0, - formatList[fidx].getName(), - formatList[fidx].getInputOptionsRef()); - optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName())); - optionDlg.exec(); - displayOptionsText(ui.inputOptionsText, ui.inputFormatCombo, true); + if (formatList[fidx].getInputOptionsRef()->size() == 0) { + QMessageBox::information + (0, appName, + tr("There are no input options for format \"%1\"").arg(formatList[fidx].getDescription())); + } + else { + OptionsDlg optionDlg(0, + formatList[fidx].getName(), + formatList[fidx].getInputOptionsRef()); + optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName())); + optionDlg.exec(); + displayOptionsText(ui.inputOptionsText, ui.inputFormatCombo, true); + } } //------------------------------------------------------------------------ void MainWindow::outputOptionButtonClicked() { int fidx = currentComboFormatIndex(ui.outputFormatCombo); - OptionsDlg optionDlg(0, formatList[fidx].getName(), formatList[fidx].getOutputOptionsRef()); - optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName())); - optionDlg.exec(); - displayOptionsText(ui.outputOptionsText, ui.outputFormatCombo, false); + if (formatList[fidx].getOutputOptionsRef()->size() == 0) { + QMessageBox::information + (0, appName, + tr("There are no output options for format \"%1\"").arg(formatList[fidx].getDescription())); + } + else { + OptionsDlg optionDlg(0, formatList[fidx].getName(), formatList[fidx].getOutputOptionsRef()); + optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName())); + optionDlg.exec(); + displayOptionsText(ui.outputOptionsText, ui.outputFormatCombo, false); + } } + //------------------------------------------------------------------------ bool MainWindow::isOkToGo() { @@ -915,7 +930,7 @@ void MainWindow::aboutActionX() //------------------------------------------------------------------------ void MainWindow::helpActionX() { - ShowHelp("gpsbabel.html"); + ShowHelp("index.html"); } //------------------------------------------------------------------------ void MainWindow::filtersClicked() diff --git a/gui/optionsdlg.cpp b/gui/optionsdlg.cpp index c6304040a..cd4634ab6 100644 --- a/gui/optionsdlg.cpp +++ b/gui/optionsdlg.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -// $Id: optionsdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $ +// $Id: optionsdlg.cpp,v 1.3 2009/09/08 16:06:32 robertl Exp $ //------------------------------------------------------------------------ // // Copyright (C) 2009 S. Khai Mong . @@ -234,6 +234,6 @@ void OptionsDlg::rejectClicked() //------------------------------------------------------------------------ void OptionsDlg::helpClicked() { - QString str = QString("gpsbabel.html") + "#fmt_" + fmtName; + QString str = "fmt_" + fmtName + ".html"; ShowHelp(str.toStdString().c_str()); } diff --git a/gui/setup.iss b/gui/setup.iss index c0a1f49a7..4b180af1c 100755 --- a/gui/setup.iss +++ b/gui/setup.iss @@ -1,97 +1,97 @@ -; $Id: setup.iss,v 1.6 2009/09/07 18:46:18 robertl Exp $ -; -; NOTE: setup.iss is generated from setup.iss.in via autoconf. -; The generated setup.iss is checked in to help keep the version numbers -; synchronized. -; -; Script for generating installation setup program for GPSBabel -; Uses the Inno setup compiler. Typically used from the command -; line "makesetup.bat" which copies QT system files which -; the Innosetup compiler cannot handle. -; -; So it is not a good idea to run this file from the Inno Setup GUI. - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. -; Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017} -AppName=GPSBabel -AppVerName=GPSBabel 1.3.7-beta20090906 -AppPublisher=GPSBabel -AppPublisherURL=http://www.gpsbabel.org -AppSupportURL=http://www.gpsbabel.org -AppUpdatesURL=http://www.gpsbabel.org -DefaultDirName={pf}\GPSBabel -DefaultGroupName=GPSBabel -OutputDir=release -OutputBaseFilename=GPSBabel-1.3.7-beta20090906-Setup -SetupIconFile=images\babel2.ico -Compression=lzma -SolidCompression=yes -LicenseFile=COPYING.txt - -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" - -[Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked - -[Files] -Source: qtdir\bin\QtCore4.dll; DestDir: "{app}"; Flags: ignoreversion -Source: qtdir\bin\QtGui4.dll; DestDir: "{app}"; Flags: ignoreversion -Source: qtdir\bin\QtWebkit4.dll; DestDir: "{app}"; Flags: ignoreversion -Source: qtdir\bin\QtXml4.dll; DestDir: "{app}"; Flags: ignoreversion -Source: qtdir\bin\QtNetwork4.dll; DestDir: "{app}"; Flags: ignoreversion -Source: qtdir\mingw\mingwm10.dll; DestDir: "{app}"; Flags: ignoreversion -Source: qtdir\plugins\*; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs - -Source: gmapbase.html; DestDir: "{app}"; Flags: ignoreversion -Source: qt.conf; DestDir: "{app}"; Flags: ignoreversion - -Source: release\gpsbabelfe.exe; DestDir: "{app}"; Flags: ignoreversion -Source: release\libexpat.dll; DestDir: "{app}"; Flags: ignoreversion -Source: release\gpsbabel.exe; DestDir: "{app}"; Flags: ignoreversion -Source: release\help\*; DestDir: "{app}\help"; Flags: ignoreversion recursesubdirs createallsubdirs - -; Translation strings extracted from source code. Include it in the dist -; so that users can translate if they want to. -Source: gpsbabel_de.ts; DestDir: "{app}"; Flags: ignoreversion -Source: gpsbabel_es.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabel_fr.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabel_hu.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabel_it.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_de.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_es.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_fr.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_hu.ts; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_it.ts; DestDir: "{app}\translations"; Flags: ignoreversion - -; Compiled translation strings that are used at runtime. -; Only Spanish is adequately translated for now. -Source: gpsbabel_es.qm; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_es.qm; DestDir: "{app}\translations"; Flags: ignoreversion - -; German is usable -Source: gpsbabel_de.qm; DestDir: "{app}\translations"; Flags: ignoreversion -Source: gpsbabelfe_de.qm; DestDir: "{app}\translations"; Flags: ignoreversion - -; Now translations from Qt's own UI stuff. -Source: qtdir\translations\*; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs - -; Miscellaneous -Source: COPYING; DestDir: {app}; Flags: ignoreversion -; Source: AUTHORS; DestDir: {app}; Flags: ignoreversion -; Source: README.contrib; DestDir: {app}; Flags: ignoreversion -; Source: README.gui; DestDir: {app}; Flags: ignoreversion - - -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{group}\GPSBabel"; Filename: "{app}\gpsbabelfe.exe" -Name: "{commondesktop}\GPSBabel"; Filename: "{app}\gpsbabelfe.exe"; Tasks: desktopicon - -[Run] -Filename: "{app}\gpsbabelfe.exe"; Description: "{cm:LaunchProgram,GPSBabelFE}"; Flags: nowait postinstall skipifsilent - +; $Id: setup.iss,v 1.7 2009/09/08 16:06:32 robertl Exp $ +; +; NOTE: setup.iss is generated from setup.iss.in via autoconf. +; The generated setup.iss is checked in to help keep the version numbers +; synchronized. +; +; Script for generating installation setup program for GPSBabel +; Uses the Inno setup compiler. Typically used from the command +; line "makesetup.bat" which copies QT system files which +; the Innosetup compiler cannot handle. +; +; So it is not a good idea to run this file from the Inno Setup GUI. + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. +; Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017} +AppName=GPSBabel +AppVerName=GPSBabel 1.3.7-beta20090906 +AppPublisher=GPSBabel +AppPublisherURL=http://www.gpsbabel.org +AppSupportURL=http://www.gpsbabel.org +AppUpdatesURL=http://www.gpsbabel.org +DefaultDirName={pf}\GPSBabel +DefaultGroupName=GPSBabel +OutputDir=release +OutputBaseFilename=GPSBabel-1.3.7-beta20090906-Setup +SetupIconFile=images\babel2.ico +Compression=lzma +SolidCompression=yes +LicenseFile=COPYING.txt + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: qtdir\bin\QtCore4.dll; DestDir: "{app}"; Flags: ignoreversion +Source: qtdir\bin\QtGui4.dll; DestDir: "{app}"; Flags: ignoreversion +Source: qtdir\bin\QtWebkit4.dll; DestDir: "{app}"; Flags: ignoreversion +Source: qtdir\bin\QtXml4.dll; DestDir: "{app}"; Flags: ignoreversion +Source: qtdir\bin\QtNetwork4.dll; DestDir: "{app}"; Flags: ignoreversion +Source: qtdir\mingw\mingwm10.dll; DestDir: "{app}"; Flags: ignoreversion +Source: qtdir\plugins\*; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs + +Source: gmapbase.html; DestDir: "{app}"; Flags: ignoreversion +Source: qt.conf; DestDir: "{app}"; Flags: ignoreversion + +Source: release\gpsbabelfe.exe; DestDir: "{app}"; Flags: ignoreversion +Source: release\libexpat.dll; DestDir: "{app}"; Flags: ignoreversion +Source: release\gpsbabel.exe; DestDir: "{app}"; Flags: ignoreversion +Source: release\help\*; DestDir: "{app}\help"; Flags: ignoreversion recursesubdirs createallsubdirs + +; Translation strings extracted from source code. Include it in the dist +; so that users can translate if they want to. +Source: gpsbabel_de.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabel_es.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabel_fr.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabel_hu.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabel_it.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_de.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_es.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_fr.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_hu.ts; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_it.ts; DestDir: "{app}\translations"; Flags: ignoreversion + +; Compiled translation strings that are used at runtime. +; Only Spanish is adequately translated for now. +Source: gpsbabel_es.qm; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_es.qm; DestDir: "{app}\translations"; Flags: ignoreversion + +; German is usable +Source: gpsbabel_de.qm; DestDir: "{app}\translations"; Flags: ignoreversion +Source: gpsbabelfe_de.qm; DestDir: "{app}\translations"; Flags: ignoreversion + +; Now translations from Qt's own UI stuff. +Source: qtdir\translations\*; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs + +; Miscellaneous +Source: COPYING; DestDir: {app}; Flags: ignoreversion +; Source: AUTHORS; DestDir: {app}; Flags: ignoreversion +; Source: README.contrib; DestDir: {app}; Flags: ignoreversion +; Source: README.gui; DestDir: {app}; Flags: ignoreversion + + +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{group}\GPSBabel"; Filename: "{app}\gpsbabelfe.exe" +Name: "{commondesktop}\GPSBabel"; Filename: "{app}\gpsbabelfe.exe"; Tasks: desktopicon + +[Run] +Filename: "{app}\gpsbabelfe.exe"; Description: "{cm:LaunchProgram,GPSBabelFE}"; Flags: nowait postinstall skipifsilent + diff --git a/gui/setup.iss.in b/gui/setup.iss.in index 8a478573e..b41066446 100755 --- a/gui/setup.iss.in +++ b/gui/setup.iss.in @@ -1,4 +1,4 @@ -; $Id: setup.iss.in,v 1.4 2009/09/07 18:46:19 robertl Exp $ +; $Id: setup.iss.in,v 1.5 2009/09/08 16:06:32 robertl Exp $ ; ; NOTE: setup.iss is generated from setup.iss.in via autoconf. ; The generated setup.iss is checked in to help keep the version numbers @@ -56,7 +56,7 @@ Source: release\help\*; DestDir: "{app}\help"; Flags: ignoreversion r ; Translation strings extracted from source code. Include it in the dist ; so that users can translate if they want to. -Source: gpsbabel_de.ts; DestDir: "{app}"; Flags: ignoreversion +Source: gpsbabel_de.ts; DestDir: "{app}\translations"; Flags: ignoreversion Source: gpsbabel_es.ts; DestDir: "{app}\translations"; Flags: ignoreversion Source: gpsbabel_fr.ts; DestDir: "{app}\translations"; Flags: ignoreversion Source: gpsbabel_hu.ts; DestDir: "{app}\translations"; Flags: ignoreversion -- 2.30.2